﻿@{
    ViewBag.Title = "Task - Update";
}

<div class="page-header">
    <h3>Task CRUD operations.</h3>
</div>

<div class="panel panel-default">
    <div class="panel-body">
        <form role="form">
            <select class="form-control" id="options"></select>
        </form>
        <div class="form-group">
            <span id='Result1'>(Result)</span>
        </div>
    </div>
</div>

@section scripts {
    <script>
        $(document).ready(function () {
            $.ajax({
                type: 'GET',
                url: '/CoreApi/Task'
            }).done(function (data) {
                $.each(data, function (key, item) {
                    $("#options").append($("<option />").val(item.TaskID).text(item.TaskName));
                }).error(function (jqXHR, textStatus, errorThrown) {
                    $('#Result1').text(jqXHR.responseText || textStatus);
                });
            });
        });
    </script>
}